using System;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Linq.Expressions;

namespace ReactiveCode.Observables
{
    public class ConvertToObservableException: Exception
    {
        public Type ExpectedExpressionType { get; private set; }
        public Expression ActualExpression { get; private set; }

        public ConvertToObservableException(Type expected, Expression actual)
            : base("ConvertToObservable returned an expression of a wrong type.")
        {
            Contract.Requires<ArgumentNullException>(expected != null, "expected");
            Contract.Requires<ArgumentNullException>(actual != null, "actual");

            ExpectedExpressionType = expected;
            ActualExpression = actual;
        }
    }
}